﻿///----------Menu Screen------------
function ValidateAddCategory(TextBox) {
    var CategoryTextBox = document.getElementById(TextBox.id);
    if (CategoryTextBox.value == '') {
        alert('Please Enter Value In Category TextBox.');
        return false;
    }
    else
        return true;

}

///---------Add Category SCreen--------

function ValidateAddSubCategory(TextBox, CategoryList) {
    var CategoryTextBox = document.getElementById(TextBox.id);
    var CategoryItems = document.getElementById(CategoryList.id);
    if (CategoryItems.options[CategoryItems.selectedIndex].value == '0') {
        alert('Please Select Category.');
        return false;
    }
    else {
        if (CategoryTextBox.value == '') {
            alert('Please Enter Value In Sub Category TextBox.');
            return false;

        }
    }
    return true;
}


///---------Add Song Album Screen--------

function ValidateAddSongAlbum(CategoryList,SubCategoryList,txtAlbumName,txtAlbumYear,txtAlbumCover,txtAlbumOwner) {
    var CategoryItems = document.getElementById('ctl00_ContentPlaceHolder1_' + CategoryList);
    var SubCategoryItems = document.getElementById('ctl00_ContentPlaceHolder1_' + SubCategoryList);
    var AlbumName = document.getElementById('ctl00_ContentPlaceHolder1_' + txtAlbumName);
    var AlbumYear = document.getElementById('ctl00_ContentPlaceHolder1_' + txtAlbumYear);
    var AlbumCover = document.getElementById('ctl00_ContentPlaceHolder1_' + txtAlbumCover);
    var AlbumOwner = document.getElementById('ctl00_ContentPlaceHolder1_' + txtAlbumOwner);

    if (CategoryItems.options[CategoryItems.selectedIndex].value == '0') {
        alert('Please Select Category.');
        return false;
    }

    if (SubCategoryItems.options[SubCategoryItems.selectedIndex].value == '0') {
        alert('Please Select Sub Category.');
        return false;
    }

    if (AlbumName.value == '') {
        alert('Please Enter Album Name.');
        return false;
    }

    if (AlbumYear.value == '') {
        alert('Please Enter Album Year.');
        return false;
    }
    
    if (AlbumOwner.value == '') {
        alert('Please Enter Owner Name.');
        return false;
    }
    
    if (AlbumCover.value == '') {
        alert('Please Browse Album Cover.');
        return false;
    }

  
    return true;
}


///---------Add Song Download Link Screen--------

function ValidateAddSongDownloadLink(SongCategoryList, AlbumList, txtSongTitle, txtArtistName, txtDownloadLink,txtLinkOwner) {
    var SongCategoryItems = document.getElementById('ctl00_ContentPlaceHolder1_' + SongCategoryList);
    var AlbumItems = document.getElementById('ctl00_ContentPlaceHolder1_' + AlbumList);
    var SongTitle = document.getElementById('ctl00_ContentPlaceHolder1_' + txtSongTitle);
    var ArtistName = document.getElementById('ctl00_ContentPlaceHolder1_' + txtArtistName);
    var DownloadLink = document.getElementById('ctl00_ContentPlaceHolder1_' + txtDownloadLink);
    var LinkOwner = document.getElementById('ctl00_ContentPlaceHolder1_' + txtLinkOwner);


    if (SongCategoryItems.options[SongCategoryItems.selectedIndex].value == '0') {
        alert('Please Select Song Category.');
        return false;
    }

    if (AlbumItems.options[AlbumItems.selectedIndex].value == '0') {
        alert('Please Select Album.');
        return false;
    }

    if (SongTitle.value == '') {
        alert('Please Enter Song Title.');
        return false;
    }

    if (ArtistName.value == '') {
        alert('Please Enter Artst Name.');
        return false;
    }

    if (DownloadLink.value == '') {
        alert('Please Enter Download Link.');
        return false;
    }

    if (LinkOwner.value == '') {
        alert('Please Enter Link Owner.');
        return false;
    }

    return true;
}

///---------Add Movie Screen--------

function ValidateAddMovie(CategoryList,SubCategoryList,ServerList,txtMovieName,txtMovieYear,txtMovieSize,txtMovieGenre,txtMovieOwner,txtMovieDescription,txtMovieCover) {
    var CategoryItems = document.getElementById('ctl00_ContentPlaceHolder1_' + CategoryList);
    var SubCategoryItems = document.getElementById('ctl00_ContentPlaceHolder1_' + SubCategoryList);
    var ServerItems = document.getElementById('ctl00_ContentPlaceHolder1_' + ServerList);
    var MovieName = document.getElementById('ctl00_ContentPlaceHolder1_' + txtMovieName);
    var MovieYear = document.getElementById('ctl00_ContentPlaceHolder1_' + txtMovieYear);
    var MovieSize = document.getElementById('ctl00_ContentPlaceHolder1_' + txtMovieSize);
    var MovieGenre = document.getElementById('ctl00_ContentPlaceHolder1_' + txtMovieGenre);
    var MovieOwner = document.getElementById('ctl00_ContentPlaceHolder1_' + txtMovieOwner);
    var MovieDescription = document.getElementById('ctl00_ContentPlaceHolder1_' + txtMovieDescription);
    var MovieCover = document.getElementById('ctl00_ContentPlaceHolder1_' + txtMovieCover);

    if (CategoryItems.options[CategoryItems.selectedIndex].value == '0') {
        alert('Please Select Category.');
        return false;
    }

    if (SubCategoryItems.options[SubCategoryItems.selectedIndex].value == '0') {
        alert('Please Select Sub Category.');
        return false;
    }

    if (ServerItems.options[ServerItems.selectedIndex].value == '0') {
        alert('Please Select Movie Server.');
        return false;
    }


    if (MovieName.value == '') {
        alert('Please Enter Movie Name.');
        return false;
    }

    if (MovieYear.value == '') {
        alert('Please Enter Movie Year.');
        return false;
    }

    if (MovieSize.value == '') {
        alert('Please Enter Movie Size.');
        return false;
    }

    if (MovieGenre.value == '') {
        alert('Please Enter Movie Genre.');
        return false;
    }

    if (MovieOwner.value == '') {
        alert('Please Enter Movie Owner.');
        return false;
    }

    if (MovieDescription.value == '') {
        alert('Please Enter Movie Description.');
        return false;
    }

    if (MovieCover.value == '') {
        alert('Please Enter Movie Cover.');
        return false;
    }

    return true;
}



///---------Add Movie Screen Shots Screen--------

function ValidateMovieScreenShots(SubCategoryList, MovieList, txtMovieScreensCover) {
    var SubCategoryItems = document.getElementById('ctl00_ContentPlaceHolder1_' + SubCategoryList);
    var MovieItems = document.getElementById('ctl00_ContentPlaceHolder1_' + MovieList);
    var MovieScreen = document.getElementById('ctl00_ContentPlaceHolder1_' + txtMovieScreensCover);


    if (SubCategoryItems.options[SubCategoryItems.selectedIndex].value == '0') {
        alert('Please Select Sub Category.');
        return false;
    }

    if (MovieItems.options[MovieItems.selectedIndex].value == '0') {
        alert('Please Select Movie Name.');
        return false;
    }


    if (MovieScreen.value == '') {
        alert('Please Enter Movie Screens.');
        return false;
    }

    return true;
}



///---------Add Movie Download Link Screen--------

function ValidateMovieDownloadLink(SubCategoryList, MovieList,txtMoviePartNo,txtDownloadLink,txtLinkSize, txtLinkOwner) {
    var SubCategoryItems = document.getElementById('ctl00_ContentPlaceHolder1_' + SubCategoryList);
    var MovieItems = document.getElementById('ctl00_ContentPlaceHolder1_' + MovieList);
    var PartNo = document.getElementById('ctl00_ContentPlaceHolder1_' + txtMoviePartNo);
    var DownloadLink = document.getElementById('ctl00_ContentPlaceHolder1_' + txtDownloadLink);
    var LinkSize = document.getElementById('ctl00_ContentPlaceHolder1_' + txtLinkSize);
    var LinkOwner = document.getElementById('ctl00_ContentPlaceHolder1_' + txtLinkOwner);

    if (SubCategoryItems.options[SubCategoryItems.selectedIndex].value == '0') {
        alert('Please Select Sub Category.');
        return false;
    }

    if (MovieItems.options[MovieItems.selectedIndex].value == '0') {
        alert('Please Select Movie Name.');
        return false;
    }


    if (PartNo.value == '') {
        alert('Please Enter Movie Part No.');
        return false;
    }

    if (DownloadLink.value == '') {
        alert('Please Enter Download Link.');
        return false;
    }

    if (LinkSize.value == '') {
        alert('Please Enter Link Size.');
        return false;
    }

    if (LinkOwner.value == '') {
        alert('Please Enter Link Owner.');
        return false;
    }

    return true;
}



///---------Add Online Game Screen--------

function ValidateAddOnlineGame(SubCategoryList, txtGameName, txtGameDescription,txtGameOwner,txtGameCover) {
    var SubCategoryItems = document.getElementById('ctl00_ContentPlaceHolder1_' + SubCategoryList);
    var GameName = document.getElementById('ctl00_ContentPlaceHolder1_' + txtGameName);
    var GameDescription = document.getElementById('ctl00_ContentPlaceHolder1_' + txtGameDescription);
    var GameOwner = document.getElementById('ctl00_ContentPlaceHolder1_' + txtGameOwner);
    var GameCover = document.getElementById('ctl00_ContentPlaceHolder1_' + txtGameCover);


    if (SubCategoryItems.options[SubCategoryItems.selectedIndex].value == '0') {
        alert('Please Select Sub Category.');
        return false;
    }


    if (GameName.value == '') {
        alert('Please Enter Game Name.');
        return false;
    }

//    if (GameDescription.value == '') {
//        alert('Please Enter Game Description.');
//        return false;
//    }

    if (GameOwner.value == '') {
        alert('Please Enter Game Owner.');
        return false;
    }

    if (GameCover.value == '') {
        alert('Please Enter Game Cover.');
        return false;
    }

    return true;
}

///---------Add FaceBookCover Screen--------

function ValidateAddFacebookCover(SubCategoryList, txtCoverName, txtCoverOwner, txtCoverPath) {
    var SubCategoryItems = document.getElementById('ctl00_ContentPlaceHolder1_' + SubCategoryList);
    var CoverName = document.getElementById('ctl00_ContentPlaceHolder1_' + txtCoverName);
    var CoverOwner = document.getElementById('ctl00_ContentPlaceHolder1_' + txtCoverOwner);
    var CoverPath = document.getElementById('ctl00_ContentPlaceHolder1_' + txtCoverPath);


    if (SubCategoryItems.options[SubCategoryItems.selectedIndex].value == '0') {
        alert('Please Select Sub Category.');
        return false;
    }


    if (CoverName.value == '') {
        alert('Please Enter Cover Name.');
        return false;
    }

    if (CoverOwner.value == '') {
        alert('Please Enter Cover Owner.');
        return false;
    }

    if (CoverPath.value == '') {
        alert('Please Enter Cover Path.');
        return false;
    }

    return true;
}

///---------Add SMS Screen--------

function ValidateAddSMS(SubCategoryList, txtSMS, txtLanguage, txtSmsOwner) {
    var SubCategoryItems = document.getElementById('ctl00_ContentPlaceHolder1_' + SubCategoryList);
    var SMS = document.getElementById('ctl00_ContentPlaceHolder1_' + txtSMS);
    var SMSLanguage = document.getElementById('ctl00_ContentPlaceHolder1_' + txtLanguage);
    var SMSOwner = document.getElementById('ctl00_ContentPlaceHolder1_' + txtSmsOwner);


    if (SubCategoryItems.options[SubCategoryItems.selectedIndex].value == '0') {
        alert('Please Select Sub Category.');
        return false;
    }


    if (SMS.value == '') {
        alert('Please Enter SMS.');
        return false;
    }

    if (SMSLanguage.value == '') {
        alert('Please Enter SMS Language.');
        return false;
    }

    if (SMSOwner.value == '') {
        alert('Please Enter SMS Owner.');
        return false;
    }

    return true;
}